﻿using System;
using UnityEngine;

// Token: 0x02000150 RID: 336
public class TireMark : MonoBehaviour
{
	// Token: 0x0600060D RID: 1549 RVA: 0x00031A94 File Offset: 0x0002FC94
	private void Update()
	{
		if (this.fading)
		{
			if (this.alpha <= 0f)
			{
				UnityEngine.Object.Destroy(base.gameObject);
			}
			else
			{
				this.alpha -= Time.deltaTime;
				for (int i = 0; i < this.colors.Length; i++)
				{
					Color[] array = this.colors;
					int num = i;
					array[num].a = array[num].a - Time.deltaTime;
				}
				this.mesh.colors = this.colors;
			}
		}
		else if (this.fadeTime > 0f)
		{
			this.fadeTime = Mathf.Max(0f, this.fadeTime - Time.deltaTime);
		}
		else if (this.fadeTime == 0f)
		{
			this.fading = true;
		}
	}

	// Token: 0x0400095D RID: 2397
	[NonSerialized]
	public float fadeTime = -1f;

	// Token: 0x0400095E RID: 2398
	private bool fading;

	// Token: 0x0400095F RID: 2399
	private float alpha = 1f;

	// Token: 0x04000960 RID: 2400
	[NonSerialized]
	public Mesh mesh;

	// Token: 0x04000961 RID: 2401
	[NonSerialized]
	public Color[] colors;
}
